--MiK: Zmena hlavicky makra pro QI Mobile (SPOUSTET)
<g>
Update dbo.A134U0 set TS0 = GetDate(), UserIC = 1105, UserU = 0, A258U0 = 'procedure(ID: string);
// parametrem bude ID varianty formuláře
begin
  // Adaptica následně doplní obsah
end.' where (ic = 2061497) and (u = 11241)
</g>



--PeM: Naplnění názvu a identifikace partnera na dokladech IDLV (NESPOUSTET)
<g>
update DOKL set a33798u10 = a33654u10 from a3804u10 as DOKL
  join a127217u9 as IDLV on DOKL.ic = IDLV.ic and DOKL.u = IDLV.u
  join a5389u10 as LINK on DOKL.ic = LINK.ic_b and DOKL.u = LINK.u_b 
  join a149u0 as OJ on LINK.ic_a = OJ.ic and LINK.u_a = OJ.u
</g>

<g>
update DOKL set a33800u10 = a18734u10 from a3804u10 as DOKL
  join a127217u9 as IDLV on DOKL.ic = IDLV.ic and DOKL.u = IDLV.u
  join a5389u10 as LINK on DOKL.ic = LINK.ic_b and DOKL.u = LINK.u_b 
  join a130u0 as SUB on LINK.ic_a = SUB.ic and LINK.u_a = SUB.u
</g>


-- Doprava: doplneni ceny spotreby phm do rozpadu polozky (NESPOUSTET)
<g>
-- seznam aktualizovanych akci
select distinct rozpad.ic_b ic, rozpad.u_b u
into #dingo_actions
from
  a1043123u10 rozpad
  inner join a117255u10212 spotreba on rozpad.ic_a = spotreba.ic and rozpad.u_a = spotreba.u and a1046275u10 is null
  inner join a29555u10 polozka on spotreba.ic = polozka.ic and spotreba.u = polozka.u and a461978u10 <> 0

-- neplatny vysledek akce
update act set useric = 1105, useru = 0, ts0 = getdate(), a21554437u10 = 1
from
  #dingo_actions
  inner join A4222U10 act on #dingo_actions.ic = act.ic and #dingo_actions.u = act.U and a21554437u10 is null

-- naplneni cenu v rozpadu polozky na akci
update rozpad set useric = 1105, useru = 0, ts0 = getdate(), a1046275u10 = a461978u10
from
  a1043123u10 rozpad
  inner join a117255u10212 spotreba on rozpad.ic_a = spotreba.ic and rozpad.u_a = spotreba.u and a1046275u10 is null
  inner join a29555u10 polozka on spotreba.ic = polozka.ic and spotreba.u = polozka.u and a461978u10 <> 0

-- odstraneni objektu
drop table #dingo_actions
</g>

-- ZS doplneni chybejicich poradi udalosti maker QI Mobile - SPUSTIT
<g>
  UPDATE a141u0 SET UserIC = 1105, UserU = 0, TS0 = GetDate(), a2585u0 = 20 WHERE (u = 11241) AND a2585u0 IS NULL
  UPDATE a195u0 SET UserIC = 1105, UserU = 0, TS0 = GetDate(), a2588u0 = 20 WHERE (u = 11241) AND a2588u0 IS NULL
  UPDATE a2195u0 SET UserIC = 1105, UserU = 0, TS0 = GetDate(), a2589u0 = 20 WHERE (u = 11241) AND a2589u0 IS NULL
</g>

-- WMS: oprava integrity po aplikaci oprav
<g>
  delete from a189234u10 where (ic = 168891 or ic = 168870) and u = 11011
</g>
